home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
eventq.exe
/
README
< prev
next >
Wrap
Text File
|
1991-07-13
|
2KB
|
33 lines
In a standard Turbo Vision application, the TApplication event queue is only
one event deep. That is, you can only PutEvent a single event; any subsequent
PutEvent before the occurrence of a GetEvent will overwrite the original
event. The EVENTQ unit implements an event queue, so that you can stuff a
number of simulated keystrokes into a Turbo Vision application. Two possible
applications for this technique are:
1) Normally, after a dialog box closes, the Turbo Vision main menu returns to
its inactive state, with none of the menus pulled down. However, if you have
implemented a multi-level menu, it may make more sense for the menu to remain
in a pulled-down state after a dialog box is closed. Thus, if you are three
levels deep in a menu, and you issue a command on that menu, you can, as the
last part of the processing of that command, put the appropriate keystrokes
into the event queue to pull the menu down to the same location. For example,
in the Turbo Pascal IDE, when the Options/Environment/Preferences dialog box
closes, all of the pulled-down menus are gone. It might be appropriate at the
end of the Preferences dialog box processing to insert an Alt-O and an E into
the event queue, so that the menus are restored to the same state that
existed immediately before the Preferences command was issued.
2) You can use the ability to put simulated keystrokes into the event queue
to run a Turbo Vision program from a script file (as a self-running demo, for
example). The SCRDEMO.PAS file contains code which, in conjunction with the
TVDEMO.PAS program that comes with Turbo Pascal, demonstrates this technique.
Instructions for using SCRDEMO are contained in the file. SCRIPT.SCR is the
script file used by SCRDEMO; it contains a description of the script command
language.
Any comments, questions, suggestions, etc. should be directed to:
Steve Schafer
71121,1771